
{block name="style"}
<link rel="stylesheet" href="{__CSS__}/user.css?v={:get_system_config('web','version')}" media="all">
<link rel="stylesheet" href="{__STATIC__}/assets/gougu/css/gougu.css" media="all">
<link rel="stylesheet" href="{__STATIC__}/assets/layui/css/layui.css" media="all">
{/block}
<!-- 主体 -->
{block name="body"}
<form action="{:url('/api/import/import_staff')}" method="post" enctype="multipart/form-data">
  <input type="file" name="file">
  <input type="submit" value="上传文件" name="submit">
</form>
<div class="layui-layer layui-layer-page" id="layui-layer1" type="page" times="1" showtime="0" contype="string"  position: fixed;>
	<form class="layui-form gg-form-bar border-t border-x">
		<div class="layui-input-inline">
			<select name="kid">
								<option value="18">2023学年第1学期期中考试</option>
								<option value="16">2022学年第1学期期末考试</option>
								<option value="15">2021学年第二学期期末考试</option>
							</select>
		</div>

		<div class="layui-input-inline">
		<button class="layui-btn layui-btn-danger" lay-submit lay-filter="sumform">统计学生成绩</button>
		<button class="layui-btn layui-btn-normal" lay-submit lay-filter="searchform">提交搜索</button>
	
		</div>
		<div class="layui-btn-container">
  <button type="button" class="layui-btn demo-class-accept" lay-options="{accept: 'file'}">
    <i class="layui-icon layui-icon-upload"></i> 
    上传文件
  </button>
  <button type="button" class="layui-btn demo-class-accept" lay-options="{
    accept: 'file',
    exts: 'zip|rar|7z'
  }">
    <i class="layui-icon layui-icon-upload"></i> 
    只允许压缩文件
  </button>
 
</div>
	</form>
	<form class="layui-form gg-form-bar border-t border-x">
		<div class="layui-input-inline">
			<select name="kid">
								<option value="18">2023学年第1学期期中考试</option>
								<option value="16">2022学年第1学期期末考试</option>
								<option value="15">2021学年第二学期期末考试</option>
							</select>
		</div>

		<div class="layui-input-inline">
		<button class="layui-btn layui-btn-danger" lay-submit lay-filter="sumform">统计学生成绩</button>
		<button class="layui-btn layui-btn-normal" lay-submit lay-filter="searchform">提交搜索</button>
	
		</div>
		<div class="layui-btn-container">
  <button type="button" class="layui-btn demo-class-accept" lay-options="{accept: 'file'}">
    <i class="layui-icon layui-icon-upload"></i> 
    上传文件
  </button>

 
</div>
	</form>
</div>

 

{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}

<script src="{__STATIC__}/assets/layui/layui.js"></script>
<script>
		layui.use(function(){
		var table = layui.table,tool = layui.tool, form = layui.form;
		var layer=layui.layer;
		var $=layui.jquery;
		var upload = layui.upload;
  // 渲染
  upload.render({
    elem: '.demo-class-accept', // 绑定多个元素
    url: '/home/test/import_class', // 此处配置你自己的上传接口即可
    accept: 'file', // 普通文件
    done: function(res){
      layer.msg('上传成功');
      console.log(res);
    }
  });


		//监听执行统计提交
		form.on('submit(sumform)', function(data) {	
	    var kid = data.field.kid;
	    //将表单数据提交到后台
	    $.post("/home/test/import_class", {kid:kid, grades:grades},function(resp){
	    	layer.msg(JSON.stringify(resp));

	    });
			return false;
		});
		});

</script>
{/block}
<!-- /脚本 -->